1. Technical Field
The present invention relates to image processing apparatuses and image processing methods that generate image data by decoding compressed data compressed through a compression process that includes a variable-length coding process, and that process the generated image data.
2. Related Art
As an example of such an image processing apparatus, an apparatus has been proposed that carries out a rotation process while decoding a compressed image compressed by converting each of 8×8 pixel blocks into which an image has been divided into frequency components and encoding the blocks through variable-length coding such as Huffman coding (for example, see JP-A-9-247423). When this apparatus obtains a compressed image into which a restart marker used in the rotation process has not been inserted, the compressed image is first Huffman-decoded, and then as each block is encoded, a restart marker is inserted each time the encoding of a predetermined number of blocks is completed; through this, a compressed image in which a restart marker is inserted every stripe width (that is, every predetermined number of blocks) is generated. The process of rotating this compressed image is carried out by repeating a process in which a predetermined number of blocks is decoded, the data of a pre-set number of restart markers is skipped each time a restart marker appears, and the next block therebelow in the same stripe is decoded; when all of the blocks in a single stripe width have been decoded, the decoded blocks are then rotated. Then, when the decoding and rotation process for a single stripe width is complete, the process moves to a block in the next stripe width, and repeats the same process for each stripe width, rotating the compressed image while decoding. As a result, a compressed image can be decoded and rotated by decoding and rotating the blocks in a single stripe width one by one in order, even for images in which coded blocks produced by variable-length coding have different data lengths.
Incidentally, in the stated image processing apparatus, it is necessary, in order to insert the restart marker, to Huffman-decode the compressed image and then once again Huffman-code the image, as pre-processing for the rotation process; if this pre-processing is included, the rotation process takes a long time. For example, considering a case of rotated printing, in which an image to be printed is displayed in a display device and the image is rotated and printed after standing by for an instruction from a user, a display process that decodes a compressed image, creates a display image, and displays that image in the display device is executed, after which the apparatus stands by; when an instruction for rotated printing is made, a compressed image in which the restart markers have been inserted is created by executing the stated pre-processing on the compressed image. After this, that compressed image is decoded and rotated on a stripe width-by-stripe width basis using the restart markers, print data is created from the rotated image, and the printing process is executed. As a result, it takes a long time from when the user instructs the rotated printing to when the printing is actually carried out.